import type { FormSchema } from '@/components/core/schema-form/';

export const useRoleSchema = (): FormSchema<API.UpdateRoleParams>[] => [
  {
    field: 'roleName',
    component: 'Input',
    label: '角色名称',
    colProps: {
      span: 12,
    },
    rules: [{ required: true, type: 'string' }],
  },
  {
    field: 'roleId',
    component: 'Input',
    label: '角色编码',
    colProps: {
      span: 12,
    },
    componentProps: {
      disabled: true,
    },
    vIf: ({ formModel }) => formModel.roleId,
  },
  {
    field: 'remark',
    component: 'InputTextArea',
    label: '备注说明',
    colProps: {
      span: 24,
    },
    rules: [{ required: true, type: 'string' }],
  },
];
